package flexo.examples;

import flexo.file.FileSystem;
import flexo.graphic.GraphicSystem;
import flexo.gui.GuiSystem;
import flexo.input.InputSystem;
import flexo.physic.PhysicSystem;
import flexo.scene.SceneSystem;
import flexo.state.StateSystem;

public abstract class Test_Base extends flexo.state.State
{
	GraphicSystem graphic;
	SceneSystem scene;
	InputSystem input;
	FileSystem file;
	GuiSystem gui;
	StateSystem state;
	PhysicSystem physics;

	@Override
	public void init()
	{
		graphic = (GraphicSystem)flexo.Kernel.getSystem(GraphicSystem.ID);
		scene = (SceneSystem)flexo.Kernel.getSystem(SceneSystem.ID);
		input = (InputSystem)flexo.Kernel.getSystem(InputSystem.ID);
		file = (FileSystem)flexo.Kernel.getSystem(FileSystem.ID);
		physics = (PhysicSystem)flexo.Kernel.getSystem(flexo.physic.PhysicSystem.ID); 
		gui = (GuiSystem)flexo.Kernel.getSystem(GuiSystem.ID);
		state = (StateSystem)flexo.Kernel.getSystem(StateSystem.ID);
	}
	
	public static void run(String state)
	{		
		flexo.Kernel.addSystem(new flexo.state.StateSystem(state));
		flexo.Kernel.addSystem(new flexo.scene.SceneSystem());
		// Panoramic aspect ratio
		//flexo.Kernel.addSystem(new GraphicSystem(1024,600,"FLEXO Engine",false));
		// 4:3 aspect ratio
		flexo.Kernel.addSystem(new GraphicSystem(800,600,"FLEXO Engine",false));
		flexo.Kernel.addSystem(new InputSystem());
		flexo.Kernel.addSystem(new FileSystem());
		flexo.Kernel.addSystem(new GuiSystem());
		flexo.Kernel.addSystem(new PhysicSystem());
		
		flexo.Kernel.loop();
	}
}
